<%@ page import="com.scalar.chiptrack.utils.ConfigManager,
                 com.scalar.chiptrack.commons.Constants,
                 com.scalar.chiptrack.operations.process.forms.BomPartEntryForm"%>
 <%--
  Created by IntelliJ IDEA.
  User: Murali Krishna Yengala
  Date: May 12, 2005
  Time: 10:25:54 AM
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>

<chiptrack:checkLogon sourcePage="/fgSearch.do" />
<%String chipTracContext = "/" + ConfigManager.getChipTracContext();
try{%>

<html>
    <HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
        <META http-equiv=Content-Type content="text/html; charset=windows-1252">
        <LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type="text/css" rel="stylesheet">
    </HEAD>
    <BODY bgColor="#ffffff" leftMargin="0" topMargin="0" marginheight="0" marginwidth="0" >
    <script src="<%=chipTracContext%>/jsp/includes/scripts/functions.js"></script>
    <script src="<%=chipTracContext%>/jsp/includes/scripts/validations.js"></script>
    <SCRIPT language="JavaScript">

    function getFgiParts()
    {
        var form = document.finishedGoodsSearchForm;
        form.action = "<%=chipTracContext%>/fgSearch.do?action=getFgiParts";
        form.submit();
    }

    function search()
    {
        var form = document.finishedGoodsSearchForm;
        form.action = "<%=chipTracContext%>/fgSearch.do?action=search" ;
        form.submit();
    }


    </script>
    <!-- Top Header Start-->
    <%@ include file="/jsp/includes/header.jsp" %>
    <!-- Top Header End-->
    <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
      <TBODY >
      <TR>
        <TD width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>

        <!-- Side Navigation start -->
        <%@ include file="/jsp/operations/product_menu.jsp" %></TD>
        <!-- end of the side navigations -->

        <TD bgcolor="#ffffff">
        <IMG height=9 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=8></TD>
        <TD bgcolor="#ffffff"><IMG height=480 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=2></TD>
        <TD valign="top" width="100%">

        <IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width=500 border=0>
        <BR>
        <!-- from here your body starts -->
        <html:form action="/fgSearch.do" name="finishedGoodsSearchForm" type="com.scalar.chiptrack.operations.finishedGoods.forms.FinishedGoodsSearchForm">
            <TABLE width='95%' align=right cellpadding='3' cellspacing='2' border='0' bordercolor='black'>
                <TR><Td colspan='4' class="NArialW" align=center>Finished Goods Part Numbers</td></tr>
                <TR><TD colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></TD></TR>
                <tr><td colspan='4' align="left" class='NArialL'>&nbsp;<FONT id="errors" color='FF0000'></font></td></tr>
                <TR><TD colspan='4'><chiptrack:errors styleClass="NArialL"/></TD></TR>
                <TR><TD colspan='4'><chiptrack:info styleClass="NArialL"/></TD></TR>
                <TR><TD colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></TD></TR>
                <TR>
                    <TD class='NArialL' width='25%'> Select Base Product :</TD>
                    <TD class="NArialL" width='25%'>
                        <html:select property="baseProductId" name="finishedGoodsSearchForm" styleClass="txfield"  onchange="getFgiParts()" >
                        <html:option value="0">Select Base Product</html:option>
                        <html:options collection="baseProductsList" property="value" labelProperty="label"/>
                        </html:select>
                    </TD>
                        <TD class='NArialL'  width='25%'> Select Mkt Part Number:</TD>
                        <TD class="NArialL"  width='25%'>
                            <html:select property="fgiProductId" name="finishedGoodsSearchForm" styleClass="txfield" >
                            <html:option value="-1">Select Mkt Part Number</html:option>
                            <html:options collection="fgiProductsList" property="processStepId" labelProperty="manufacturingPartNo" />
                            </html:select>
                        </TD>
                </TR>
                <TR>
                        <TD class='NArialL'> Select Customer :</TD>
                        <TD class="NArialL">
                            <html:select property="customerId" name="finishedGoodsSearchForm" styleClass="txfield"  onchange="" >
                            <html:option value="-1">Select Customer</html:option>
                            <html:options collection="customersList" property="value" labelProperty="label"/>
                            </html:select>
                        </TD>
                        <TD class='NArialL'> Program Code:</TD>
                        <TD class="NArialL">
                            <html:text name="finishedGoodsSearchForm" property="programCode" styleClass="txfield"/>
                        </TD>
                </TR>

                <TR><TD colspan='4'>
                    <IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='20'>
                </TD></TR>
                 <br>
                 <tr>
                    <td colspan="4"><font class="NArialL">Please <a styleClass="leftsection" href="<%=chipTracContext%>\finishedGoodsCreateNew.do?action=new" onmouseover="window.status='Click here to Create a new Finshed Good';return true" onmouseout="window.status='';return true">
                    Click here</a>&nbsp;to Add OPN
                    </font></td>
                 </tr>
                 <TR>
                  <TD colspan='4' align=center>
                      <input type=image border="0" src="<%=chipTracContext%>/jsp/includes/images/search.gif" width="53" height="17" onmouseover="window.status='Click here to Search for OPN';return true" onclick="javascript:search()" onmouseout="window.status='';return true" title="Click here to Search for OPN List">
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      <a href="javascript:document.finishedGoodsSearchForm.reset()"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/reset.gif" width="53" height="17"  onmouseover="window.status='Click to Reset';return true" onmouseout="window.status='';return true" title="Click here to Reset" ></a>
                  </TD>
                </TR>
                <TR>
                    <TD colspan='4' align=center>
                    <logic:present name="finiShedGoodsList" >
                        <table border="0" width="100%" bordercolor="#FFFFFF" align=center>
                            <tr>
                              <td width="20%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Customer Name</font></td>
                              <td width="20%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Base Product Name</font></td>
                              <td width="20%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Program Code</font></td>
                              <td width="20%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Mkt Part Number</font></td>
                              <td width="20%" align="center" bgcolor="#993333"><font class="NArialL"><font color="#FFFFFF">Actions</font></td>
                            </tr>

                            <logic:iterate name="finiShedGoodsList" id="finiShedGoodsPartNumber" type="com.scalar.chiptrack.operations.finishedGoods.FinishedGoodsPartNumber" indexId="iteratorIdx">

                                <tr <%if(iteratorIdx.intValue()%2==0){%> bgcolor='#DEE1E2' <% } else {%> bgcolor='#FFFFEE' <%}%>>
                                    <td width="20%">
                                    <font class="NArialL"><bean:write name="finiShedGoodsPartNumber" property="customerName" /></font>
                                    </td>
                                    <td width="20%">
                                    <font class="NArialL"><bean:write name="finiShedGoodsPartNumber" property="basePartNumber" /></font>
                                    </td>
                                    <td width="20%">
                                    <font class="NArialL"><bean:write name="finiShedGoodsPartNumber" property="programCode" /></font>
                                    </td>
                                    <td width="10%">
                                    <font class="NArialL"><bean:write name="finiShedGoodsPartNumber" property="partNumber" /></font>
                                    </td>
                                    <td width="30%" align="center">
                                    <font class="NArialL"><a href="<%=chipTracContext%>/finishedGoodsEntry.do?loadType=view&action=viewFg&processStepId=<bean:write name="finiShedGoodsPartNumber" property="fgProcessStepId" />&customerId=<bean:write name="finiShedGoodsPartNumber" property="fgCustomerId" />" onmouseover="window.status='Click here to View Finished Good';return true" onmouseout="window.status='';return true">View</a></font>
                                    &nbsp;&nbsp;
                                    <font class="NArialL"><a href="<%=chipTracContext%>/finishedGoodsEntry.do?loadType=edit&action=editFg&processStepId=<bean:write name="finiShedGoodsPartNumber" property="fgProcessStepId" />&customerId=<bean:write name="finiShedGoodsPartNumber" property="fgCustomerId" />" onmouseover="window.status='Click here to Modify Finished Good';return true" onmouseout="window.status='';return true">Modify</a></font>
                                   </td>
                                </tr>
                            </logic:iterate>
                        </table>
                        </logic:present>
                        </TD>
                    </TR>
                 </TABLE>
                 </TD></TR>

                <TR><TD colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></TD></TR>

                </TABLE>
        </html:form>
        <!-- till here -->
        <BR><BR><BR></TD>
        <TD bgcolor="#ffffff"><IMG height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></TD>
        </TR>
        </TABLE>
        <!-- Footer starts here -->
        <%@ include file="/jsp/includes/footer.jsp" %>
        <!-- footer end here -->
    </body>
</html>
<%}catch(Exception e){e.printStackTrace() ;}%>